<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>修改订单商品 - 物流管理系统</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<style media="all" type="text/css">@import "../../../style/all.css";</style>
 	<script type="text/javascript" src="../../../js/jquery-1.8.3.js"></script>
	<script type="text/javascript">
	 $(function(){
		$("#updates").click(function(){
		  var productid = $("#productid").val();
		  var ordercounts = $("#ordercounts").val();
		  var originalprice = $("#originalprice").val();				
		  var costprice = $("#costprice").val();
		  var productremark = $("#productremark").val();
		  var customerid = $("#customerid").val();
			alert(productid+customerid);						
		   $.ajax({
			   type:"put", 
			   url:"../../../customer/updateProductById",
			   contentType:"application/json",					
			   data:JSON.stringify({"productid": productid,"ordercounts": ordercounts,"originalprice": originalprice,"costprice": costprice,"productremark":productremark}),
			   success:function(result){
				   alert(result);				   
				   window.location.href='../../getAllproductById/'+customerid;
			   }
		   });		   		
		});		
	}) 
	</script> 
</head>
<body style="background: none">
	<div class="top-bar">
		<!--a href="#" class="button">取 消</a><a href="#" class="button">保 存</a-->
		<h1>修改订单商品</h1>
		<div class="breadcrumbs">
			<a href="../../index.html" target="_top">首页</a> /
			<a href="../index.html" target="_top">客户服务中心</a>
		</div>
	</div>
	<div class="table">
		<img src="../../style/img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
		<img src="../../style/img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
<form>
		<table class="listing form" cellpadding="0" cellspacing="0">
			<tr>
				<th class="full" colspan="4">修改订单商品</th>
			</tr>
			<tr>
				<td class="first">商品编号</td>
				<td>${pro.productid}</td>
				<input type="hidden" id="productid" value="${pro.productid}" />
				<td>商品名称</td>
				<td class="last">${pro.productname}</td>
			</tr>
			<tr>
				<td class="first" >订购数量(*)</td>
				<td><input type="text" class="text" id="ordercounts" value="${pro.ordercounts}" /></td>
				<td>计量单位</td>
				<td class="last">${pro.unit}</td>
			</tr>
			<tr >
				<td class="first">单价</td>
				<td><input type="text" class="text" id="originalprice" value="${pro.originalprice}" /></td>
				<td>金额</td>
				<td><input type="text" class="text" id="costprice" value="${pro.costprice}" style="width: 100%" /></td>
			</tr>
			<tr>
				<td class="first">备注信息</td>
				<td><input type="text" class="text" id="productremark" value="${pro.productremark}" /></td>
				<td>商品说明</td>
				<td class="last">${pro.productinfo}</td>
			</tr>
			<tr>
				<td colspan="4">
					<input type="button" class="button" width="200" onclick="javascript:history.go(-1)" value="返 回"/>
					<input type="button" class="button" width="200" id="updates" value="修 改"/>
					<input type="hidden" id="customerid" value="${customerid }" />
				</td>
			</tr>
		</table>
</form>
	</div>
</body>
</html>
